[arrow-flight encode path]re-use flatbufferbuilder#10220
Conversation
|
cc @alamb |
|
run benchmark flight |
|
|
||
| impl CompressionContext { | ||
| /// Takes the stored fbb, leaving a zero-capacity placeholder. Must be returned via [`Self::return_fbb`]. | ||
| pub(crate) fn take_fbb(&mut self) -> FlatBufferBuilder<'static> { |
There was a problem hiding this comment.
Do you need to provide a take/return? Would it be possible to just reutrn a mut reference?
LIke
pub(crate) fn fbb_mut(&mut self) -> & mut FlatBufferBuilder<'static> {I think that would simplify the code a bit (and wouldn't require creating an empyt builder either)
There was a problem hiding this comment.
makes sense to me.
|
🤖 Arrow criterion benchmark running (GKE) | trigger CPU Details (lscpu)Comparing rich-T-kid/re-use-allocations (e9f85aa) to 44f3772 (merge-base) diff File an issue against this benchmark runner |
|
🤖 Arrow criterion benchmark completed (GKE) | trigger Instance: CPU Details (lscpu)Details
Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
e9f85aa to
9fadcd7
Compare
|
🤔 i've been thinking about changing the benchmarks to avoid having tokio polling be a factor. It may be more useful to benchmark the top level entry functions I.E
directly the decode path wasnt touched in this PR but its showing a drastic change we have no control over the tokio run time so it makes sense to avoid it in the benchmarks if we can. |
Which issue does this PR close?
Rationale for this change
flat buffer builder was being allocated repeatedly when it could be created once and reset using
fbb.resetWhat changes are included in this PR?
provides methods for setting and getting fbb. This avoids needing to re-allocate it on every call
Are these changes tested?
Are there any user-facing changes?